<?php

/**
 * @author shuang
 * @date 2016-11-3 13:59:53
 */
use yii\helpers\Url;
use yii\helpers\ArrayHelper;

$this->registerCssFile('/css/task.css', ['depends' => ['frontendx\assets\AppAsset']]);
?>
<!--<div class="state-bar">
    <span class="selected">全部</span>
    <span>进行中</span>
    <span>待审核</span>
    <span>已完成</span>
    <span>未通过</span>
    <span>已取消</span>
</div>-->
<div class="task-list" style="margin-bottom: 50px;">
    <?php foreach ($data as $item): ?>
        <div class="group">
            <div class="left">
                <i class="<?php echo isset(frontendx\models\WB_Task::$task_type_class[$item["type"]]) ? frontendx\models\WB_Task::$task_type_class[$item["type"]] : null; ?>"></i>
            </div>
            <div class="mid">
                <span class="title"><?php echo $item["title"]; ?></span>
                <small><?php echo $item['note']; ?></small>
                <p><i></i> <span><?php echo $item['brush_price']; ?></span></p>
            </div>
            <div class="right">
                <?php if ($item['status'] == 0): ?>
                <a href="<?php echo Url::toRoute(["task/taskdetail","id"=>$item["id"],"taskid"=>$item["taskid"]]);?>"><button class="blue">进行中</button></a>
                <?php else: ?>
                    <button class="complete">已完成</button>
                    <span><?php echo Yii::$app->formatter->asDatetime($item['uped_at']); ?></span>
                <?php endif; ?>
            </div>
        </div>
    <?php endforeach; ?>
</div>